Skip to content

Enable dual writes for Blob and DB stores#41

Merged
pablonete merged 1 commit into
mainfrom
pablonete-enable-dual-writes
Jun 24, 2026
Merged

Enable dual writes for Blob and DB stores#41
pablonete merged 1 commit into
mainfrom
pablonete-enable-dual-writes

Conversation

@pablonete

Copy link
Copy Markdown
Member

Since existing Blob and DB data is only dirty testing data, this PR skips old-data migration and moves the rollout toward a clean reset plus dual writes. It lets operators reset both stores from committed seed data, then run with Blob reads while shadow-writing Netlify DB.

Summary

  • Adds dual store composition that reads from the configured primary backend and mirrors writes to the secondary backend.
  • Adds dual magic-token storage so tokens follow the same backend mode as app data.
  • Supports KID_A_STORE_BACKEND=dual, KID_A_STORE_READ=blob|db, and KID_A_DUAL_WRITE_STRICT.
  • Removes the separate KID_A_TOKEN_BACKEND path by always deriving token storage from KID_A_STORE_BACKEND.
  • Adds npm run data:reset-stores to apply DB schema, reset Blob and DB writable data from seed JSON, and clear magic-link tokens in both stores.
  • Updates storage docs with the reset and dual-write rollout flow.

Notes for review

  • Blob remains the default backend.
  • The intended rollout is reset both stores, run dual writes with Blob reads, then switch reads to DB in a follow-up PR.
  • No UI changes; screenshots are N/A.

Validation

  • npm run --silent lint
  • npm run --silent build
  • npm run --silent build:server
  • git --no-pager diff --check

Add dual store composition for Blob and Netlify DB backends, a reset command that seeds both stores from committed JSON, and Netlify config for Blob reads with dual writes. Magic-link tokens now follow the same backend mode as application data.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@netlify

netlify Bot commented Jun 24, 2026

Copy link
Copy Markdown

Deploy Preview for kid-a ready!

Name Link
🔨 Latest commit 8cc0048
🔍 Latest deploy log https://app.netlify.com/projects/kid-a/deploys/6a3c4956384b6a00083a4733
😎 Deploy Preview https://deploy-preview-41--kid-a.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@pablonete pablonete merged commit ddf468d into main Jun 24, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant